Skip to content

fix(blink.cmp): avoid duplicate characters#128

Draft
One-In-Dark wants to merge 1 commit intoluozhiya:masterfrom
One-In-Dark:master
Draft

fix(blink.cmp): avoid duplicate characters#128
One-In-Dark wants to merge 1 commit intoluozhiya:masterfrom
One-In-Dark:master

Conversation

@One-In-Dark
Copy link

Problem:

When fittencode is used as a source of blink.cmp, the characters following the cursor will be duplicated in the completion item.

For example if the completion is triggered in "(|)" where the vertical bar '|' indicates the cursor, the completion item will be ")foo)", with an extra closing parenthesis in the beginning.

Solution:

Remove the logic that adds the following characters to the completion text, which should be only used for virtual text style.

Closes #127

@One-In-Dark
Copy link
Author

It's generated by Copilot so I can see that there's way too much noise :-(

Problem:

  When fittencode is used as a source of blink.cmp, the characters following the cursor will be duplicated in the completion item.

  For example if the completion is triggered in "(|)" where the vertical bar '|' indicates the cursor, the completion item will be ")foo)", with an extra closing parenthesis in the beginning.

Solution:

  Remove the logic that adds the following characters to the completion text, which should be only used for virtual text style.

Closes luozhiya#127
@cxwx
Copy link
Contributor

cxwx commented Jan 1, 2026

作者似乎好久没上线了哦

@One-In-Dark
Copy link
Author

作者似乎好久没上线了哦

看上去是的www, 没关系, 我也是拿它体验下 Copilot 写代码 (OpenCode 具体地说) 效果如何 :v

@luozhiya
Copy link
Owner

luozhiya commented Jan 4, 2026

在线呢,最近是事情比较多,回复不及时哈。之后我还打算有时间的话重构写个新版 😁

blink 这个插件我不太熟悉, @One-In-Dark @cxwx 这个pr你们测过效果怎么样

@cxwx
Copy link
Contributor

cxwx commented Jan 4, 2026

在线呢,最近是事情比较多,回复不及时哈。之后我还打算有时间的话重构写个新版 😁

blink 这个插件我不太熟悉, @One-In-Dark @cxwx 这个pr你们测过效果怎么样

问题是没了,但本来会跳出来的补全也没了

@One-In-Dark
Copy link
Author

先 draft 一会儿, 我一定会回来的😤

@luozhiya
Copy link
Owner

Hi @One-In-Dark @cxwx

FittenCode 重构了一个新版本,麻烦试下是否解决问题了

@cxwx
Copy link
Contributor

cxwx commented Mar 11, 2026

/blink.cmp/lua/blink/cmp/sources/lib/provider/init.lua:39: module 'fittencode.sources.blink' not found:
过去是
fittencode = {
module = "fittencode.sources.blink",
async = true,
score_offset = 1000,
transform_items = function(ctx, items) for _, item in ipairs(items) do item.kind_icon = 'ℱ' end return items end,

但是这个 module 没了,
现在是如何配置?

@cxwx
Copy link
Contributor

cxwx commented Mar 11, 2026

#129

@luozhiya
Copy link
Owner

/blink.cmp/lua/blink/cmp/sources/lib/provider/init.lua:39: module 'fittencode.sources.blink' not found: 过去是 fittencode = { module = "fittencode.sources.blink", async = true, score_offset = 1000, transform_items = function(ctx, items) for _, item in ipairs(items) do item.kind_icon = 'ℱ' end return items end,

但是这个 module 没了, 现在是如何配置?

现在配置 blink 只要改两个地方,一个是 blink.cmp source中添加 FittenCode

        sources = {
            default = { 'FittenCode' },
        },

一个是 FittenCode 中

    integrations = {
        completion = {
            -- Enable completion as an `blink.cmp` source
            blink = true
        },
    },

不需要手动指定module了

@luozhiya
Copy link
Owner

如果用module的方式的话,可以用这个路径 fittencode.integrations.completion.blink.source,这样的话就不用在 integrations 中配置了,由用户自己管理模块注入

@cxwx
Copy link
Contributor

cxwx commented Mar 12, 2026

多括号的问题应该是解决了,🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

经常补全出现多余的 { (

3 participants